﻿using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;

namespace XMainClient.UI
{
	// Token: 0x020018F7 RID: 6391
	internal class BattleMain : DlgBase<BattleMain, BattleMainBehaviour>
	{
		// Token: 0x17003A93 RID: 14995
		// (get) Token: 0x06010A7B RID: 68219 RVA: 0x004220E4 File Offset: 0x004202E4
		public BattleSkillHandler SkillHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_SkillHandler;
			}
		}

		// Token: 0x17003A94 RID: 14996
		// (get) Token: 0x06010A7C RID: 68220 RVA: 0x00422114 File Offset: 0x00420314
		public BattleIndicateHandler IndicateHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_IndicateHandler;
			}
		}

		// Token: 0x17003A95 RID: 14997
		// (get) Token: 0x06010A7D RID: 68221 RVA: 0x00422144 File Offset: 0x00420344
		public XTeamMonitorHandler TeamMonitor
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_TeamMonitor;
			}
		}

		// Token: 0x17003A96 RID: 14998
		// (get) Token: 0x06010A7E RID: 68222 RVA: 0x00422174 File Offset: 0x00420374
		public XBattleEnemyInfoHandler EnemyInfoHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_EnemyInfoHandler;
			}
		}

		// Token: 0x17003A97 RID: 14999
		// (get) Token: 0x06010A7F RID: 68223 RVA: 0x004221A4 File Offset: 0x004203A4
		public BattleTargetHandler BattleTargetHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_BattleTargetHandler;
			}
		}

		// Token: 0x17003A98 RID: 15000
		// (get) Token: 0x06010A80 RID: 68224 RVA: 0x004221D4 File Offset: 0x004203D4
		public XBattleTeamTowerHandler TeamTowerHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_TeamTowerHandler;
			}
		}

		// Token: 0x17003A99 RID: 15001
		// (get) Token: 0x06010A81 RID: 68225 RVA: 0x00422204 File Offset: 0x00420404
		public IXUILabel WarTimeLabel
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_WarTime;
			}
		}

		// Token: 0x17003A9A RID: 15002
		// (get) Token: 0x06010A82 RID: 68226 RVA: 0x00422234 File Offset: 0x00420434
		public IXUILabel LeftTimeLabel
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_LeftTime;
			}
		}

		// Token: 0x17003A9B RID: 15003
		// (get) Token: 0x06010A83 RID: 68227 RVA: 0x00422264 File Offset: 0x00420464
		public BattleDpsHandler DpsHandler
		{
			get
			{
				return this.m_DpsHandler;
			}
		}

		// Token: 0x17003A9C RID: 15004
		// (get) Token: 0x06010A84 RID: 68228 RVA: 0x0042227C File Offset: 0x0042047C
		private float _strength_preseved_precent
		{
			get
			{
				bool flag = this._current_strength_preseved > this._total_strength_preseved;
				if (flag)
				{
					this._total_strength_preseved = this._current_strength_preseved;
				}
				return this._current_strength_preseved / this._total_strength_preseved;
			}
		}

		// Token: 0x17003A9D RID: 15005
		// (get) Token: 0x06010A85 RID: 68229 RVA: 0x004222BC File Offset: 0x004204BC
		public override string fileName
		{
			get
			{
				return "Battle/BattleDlg";
			}
		}

		// Token: 0x17003A9E RID: 15006
		// (get) Token: 0x06010A86 RID: 68230 RVA: 0x004222D4 File Offset: 0x004204D4
		public override int layer
		{
			get
			{
				return 1;
			}
		}

		// Token: 0x17003A9F RID: 15007
		// (get) Token: 0x06010A87 RID: 68231 RVA: 0x004222E8 File Offset: 0x004204E8
		public override bool isMainUI
		{
			get
			{
				return true;
			}
		}

		// Token: 0x06010A88 RID: 68232 RVA: 0x004222FC File Offset: 0x004204FC
		public BattleMain()
		{
			this._showSingleNoticeCb = new XTimerMgr.ElapsedEventHandler(this.ShowSingleNotice);
			this._endBigNoticeCb = new XTimerMgr.ElapsedEventHandler(this.EndBigNotice);
			this._endBigNoticeCmdCb = new XTimerMgr.ElapsedEventHandler(this.EndBigNoticeCmd);
			this._onSwitchToTeamChatCb = new XTimerMgr.ElapsedEventHandler(this.OnSwitchToTeamChat);
			this._hideBattleChatUICb = new XTimerMgr.ElapsedEventHandler(this.HideBattleChatUI);
			BattleMain._fYellow = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("HP_Yellow"));
			BattleMain._fRed = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("HP_Red"));
		}

		// Token: 0x06010A89 RID: 68233 RVA: 0x00422528 File Offset: 0x00420728
		protected override void Init()
		{
			this._doc = XDocuments.GetSpecificDocument<XBattleDocument>(XBattleDocument.uuID);
			this.apolloDoc = XDocuments.GetSpecificDocument<XApolloDocument>(XApolloDocument.uuID);
			this._doc.BattleMainView = this;
			bool flag = XSingleton<XEntityMgr>.singleton.Player != null && XSingleton<XEntityMgr>.singleton.Player.Attributes != null;
			if (flag)
			{
				this._doc.FakeTeamAdd(XSingleton<XEntityMgr>.singleton.Player);
			}
			this.leftTimeCounter = new XLeftTimeCounter(base.uiBehaviour.m_LeftTime, true);
			this.timeConnter = new XLeftTimeCounter(base.uiBehaviour.m_WarTime, false);
			bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_MOBA || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HORSE_RACE || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_HORSERACING;
			if (flag2)
			{
				(base.uiBehaviour.m_PingFrame.GetComponent("PositionGroup") as IXPositionGroup).SetGroup(1);
				base.uiBehaviour.m_RoleInfo.gameObject.SetActive(false);
			}
			string value = XSingleton<XGlobalConfig>.singleton.GetValue("ComboBuff");
			string[] array = value.Split(XGlobalConfig.AllSeparators);
			for (int i = 0; i < array.Length; i += 3)
			{
				ComboBuff comboBuff = new ComboBuff();
				comboBuff.combo = int.Parse(array[i]);
				comboBuff.buffID = int.Parse(array[i + 1]);
				comboBuff.buffLevel = int.Parse(array[i + 2]);
				BuffTable.RowData buffData = XSingleton<XBuffTemplateManager>.singleton.GetBuffData(comboBuff.buffID, comboBuff.buffLevel);
				//bool flag3 = buffData != null;
				if (buffData != null)
				{
					comboBuff.buffName = buffData.BuffName;
				}
				else
				{
					XSingleton<XDebug>.singleton.AddErrorLog(string.Format("ComboBuff: Buff data not found: [{0} {1}]", comboBuff.buffID, comboBuff.buffLevel), null, null, null, null, null);
				}
				this._combo_buff_list.Add(comboBuff);
			}
			this.SetupHandler();
		}

		// Token: 0x06010A8A RID: 68234 RVA: 0x0042272C File Offset: 0x0042092C
		private void SetupHandler()
		{
			SceneType sceneType = XSingleton<XScene>.singleton.SceneType;
			if (sceneType <= SceneType.SCENE_WEEKEND4V4_DUCK)
			{
				if (sceneType != SceneType.SCENE_PVP)
				{
					switch (sceneType)
					{
					case SceneType.SKYCITY_FIGHTING:
						DlgHandlerBase.EnsureCreate<SkyArenaBattleHandler>(ref this.m_SkyArenaBattleHandler, base.uiBehaviour.m_canvas, true, this);
						DlgHandlerBase.EnsureCreate<SkyArenaInfoHandler>(ref this.m_SkyArenaInfoHandler, base.uiBehaviour.m_canvas, true, null);
						break;
					case SceneType.SCENE_PROF_TRIALS:
						DlgHandlerBase.EnsureCreate<ProfressionTrialsHandler>(ref this.ProfTrialsHandler, base.uiBehaviour.m_canvas, true, this);
						break;
					case SceneType.SCENE_GPR:
						break;
					case SceneType.SCENE_RESWAR_PVP:
						DlgHandlerBase.EnsureCreate<GuildMinePVPBattleHandler>(ref this.m_GuildMinePVPBattleHandler, base.uiBehaviour.m_canvas, true, null);
						DlgHandlerBase.EnsureCreate<GuildMinePVPInfoHandler>(ref this.m_GuildMinePVPInfoHandler, base.uiBehaviour.m_canvas, true, null);
						break;
					default:
						switch (sceneType)
						{
						case SceneType.SCENE_HORSE_RACE:
						case SceneType.SCENE_WEEKEND4V4_HORSERACING:
							DlgHandlerBase.EnsureCreate<RaceBattleHandler>(ref this.m_RaceBattleHandler, base.uiBehaviour.m_canvas, true, this);
							DlgHandlerBase.EnsureCreate<BattleShowInfoHandler>(ref this.m_BattleShowInfoHandler, base.uiBehaviour.m_canvas, true, this);
							break;
						case SceneType.SCENE_HEROBATTLE:
							DlgHandlerBase.EnsureCreate<HeroBattleSkillHandler>(ref this.m_HeroBattleSkillHandler, base.uiBehaviour.m_canvas, true, this);
							DlgHandlerBase.EnsureCreate<HeroBattleHandler>(ref this.m_HeroBattleHandler, base.uiBehaviour.m_canvas, true, this);
							this.m_HeroBattleSkillHandler.HandlerType = 0;
							break;
						case SceneType.SCENE_CASTLE_WAIT:
						case SceneType.SCENE_CASTLE_FIGHT:
							DlgHandlerBase.EnsureCreate<GuildBattleMiniRankHandler>(ref this.m_miniRankHandler, base.uiBehaviour.m_canvas, true, this);
							DlgHandlerBase.EnsureCreate<GuildMiniReportHandler>(ref this.m_miniReportHandler, base.uiBehaviour.m_canvas, true, this);
							break;
						case SceneType.SCENE_ABYSS_PARTY:
							DlgHandlerBase.EnsureCreate<AbyssPartyBattleHandler>(ref this.m_AbyssPartyBattleHandler, base.uiBehaviour.m_canvas, true, null);
							break;
						case SceneType.SCENE_MOBA:
							DlgHandlerBase.EnsureCreate<HeroBattleSkillHandler>(ref this.m_HeroBattleSkillHandler, base.uiBehaviour.m_canvas, true, this);
							DlgHandlerBase.EnsureCreate<MobaBattleHandler>(ref this.m_MobaBattleHandler, base.uiBehaviour.m_canvas, true, this);
							this.m_HeroBattleSkillHandler.HandlerType = 2;
							break;
						case SceneType.SCENE_WEEKEND4V4_MONSTERFIGHT:
						case SceneType.SCENE_WEEKEND4V4_GHOSTACTION:
						case SceneType.SCENE_WEEKEND4V4_LIVECHALLENGE:
						case SceneType.SCENE_WEEKEND4V4_CRAZYBOMB:
						case SceneType.SCENE_WEEKEND4V4_DUCK:
							DlgHandlerBase.EnsureCreate<WeekendPartyHandler>(ref this.m_WeekendPartyHandler, base.uiBehaviour.m_canvas, true, this);
							break;
						}
						break;
					}
				}
				else
				{
					DlgHandlerBase.EnsureCreate<BattleCaptainPVPHandler>(ref this.m_BattleCaptainPVPHandler, base.uiBehaviour.m_canvas, true, this);
				}
			}
			else if (sceneType != SceneType.SCENE_BIGMELEE_FIGHT)
			{
				if (sceneType != SceneType.SCENE_BATTLEFIELD_FIGHT)
				{
					if (sceneType == SceneType.SCENE_RIFT)
					{
						DlgHandlerBase.EnsureCreate<BattleRiftHandler>(ref this.m_riftHandler, base.uiBehaviour.m_canvas, true, this);
					}
				}
				else
				{
					DlgHandlerBase.EnsureCreate<BattleFieldBattleHandler>(ref this.m_BattleFieldBattleHandler, base.uiBehaviour.m_canvas, true, this);
				}
			}
			else
			{
				DlgHandlerBase.EnsureCreate<BigMeleeBattleHandler>(ref this.m_BigMeleeBattleHandler, base.uiBehaviour.m_canvas, true, this);
			}
			bool loadSkillHandler = XHeroBattleDocument.LoadSkillHandler;
			if (loadSkillHandler)
			{
				DlgHandlerBase.EnsureCreate<HeroBattleSkillHandler>(ref this.m_HeroBattleSkillHandler, base.uiBehaviour.m_canvas, true, this);
				this.m_HeroBattleSkillHandler.HandlerType = 1;
			}
		}

		// Token: 0x06010A8B RID: 68235 RVA: 0x00422A4C File Offset: 0x00420C4C
		public override void RegisterEvent()
		{
			base.uiBehaviour.m_avatar.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAvatarClick));
			base.uiBehaviour.m_pause.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnPauseClick));
			base.uiBehaviour.m_AutoPlay.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnAutoPlay));
			base.uiBehaviour.m_CancelAuto.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnAutoPlay));
			base.uiBehaviour.m_AutoPlayTip.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAutoPlayTip));
			base.uiBehaviour.m_HorseRide.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHorseRideClicked));
			this.m_SwitchSight = new XSwitchSight(new ButtonClickEventHandler(this.OnSightSelectClick), base.uiBehaviour.m_25D, base.uiBehaviour.m_3D, base.uiBehaviour.m_3DFree);
			base.uiBehaviour.m_BtnDamageStatistics.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnBattleStatisticsClick));
			base.uiBehaviour.m_Sight.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSightClick));
		}

		// Token: 0x06010A8C RID: 68236 RVA: 0x00422B7C File Offset: 0x00420D7C
		protected override void OnShow()
		{
			base.OnShow();
			XPlayerAttributes xplayerAttributes = XSingleton<XEntityMgr>.singleton.Player.Attributes as XPlayerAttributes;
			base.uiBehaviour.m_SightSelect.gameObject.SetActive(false);
			DlgBase<BroadMiniDlg, BroadcastMiniBehaviour>.singleton.Show(true);
			DlgBase<RadioBattleDlg, RadioBattleBahaviour>.singleton.Show(true);
			base.uiBehaviour.m_objBossRush.SetActive(XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_BOSSRUSH);
			this.lastPingTime = -60f;
			this._combo_buff_to_add = -1;
			this._combo_buff_added = -1;
			int profID = XFastEnumIntEqualityComparer<RoleType>.ToInt(XSingleton<XEntityMgr>.singleton.Player.PlayerAttributes.Profession);
			base.uiBehaviour.m_avatar.spriteName = XSingleton<XProfessionSkillMgr>.singleton.GetProfHeadIcon(profID);
			this.SetTencentImage();
			base.uiBehaviour.m_Level.SetText(string.Format("{0}", XSingleton<XAttributeMgr>.singleton.XPlayerData.Level));
			base.uiBehaviour.m_Name.SetText(XSingleton<XEntityMgr>.singleton.Player.Name);
			XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			this.SpectateInfoIsShow = false;
			XSpectateSceneDocument specificDocument2 = XDocuments.GetSpecificDocument<XSpectateSceneDocument>(XSpectateSceneDocument.uuID);
			base.uiBehaviour.m_SpectateInfo.transform.localPosition = Vector3.one * (float)XGameUI._far_far_away;
			specificDocument2.GetTargetNum(true);
			this.OnSpectateMessageChange(0, 0);
			base.uiBehaviour.m_TeamLeader.SetActive(specificDocument.bIsLeader);
			base.uiBehaviour.m_AutoPlayBorad.SetVisible(false);
			base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(false);
			base.uiBehaviour.m_SkillHandler.SetVisible(true);
			base.uiBehaviour.m_IndicateHandler.SetVisible(true);
			base.uiBehaviour.m_lblKill.SetVisible(false);
			base.uiBehaviour.m_SceneName.SetText(XSingleton<XScene>.singleton.SceneData.Comment);
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag = sceneData.TimeCounter == null || sceneData.TimeCounter.Length < 1;
			if (flag)
			{
				this.SetTimeRecord();
			}
			else
			{
				bool flag2 = sceneData.TimeCounter[0] == 1;
				if (flag2)
				{
					bool flag3 = sceneData.TimeCounter.Length > 2;
					if (flag3)
					{
						this.SetLeftTime((uint)sceneData.TimeCounter[1], (int)sceneData.TimeCounter[2]);
					}
					else
					{
						this.SetLeftTime((uint)sceneData.TimeCounter[1], -1);
					}
				}
			}
			XCombatStatisticsDocument specificDocument3 = XDocuments.GetSpecificDocument<XCombatStatisticsDocument>(XCombatStatisticsDocument.uuID);
			DlgHandlerBase.EnsureCreate<BattleDpsHandler>(ref this.m_DpsHandler, base.uiBehaviour.m_DpsPanel, this, specificDocument3.bShowDps);
			bool visible = false;
			SeqListRef<int> winCondition = sceneData.WinCondition;
			for (int i = 0; i < winCondition.Count; i++)
			{
				bool flag4 = winCondition[i, 0] == 8;
				if (flag4)
				{
					visible = true;
				}
			}
			base.uiBehaviour.m_lblKill.SetVisible(visible);
			this.UpdateKill(0);
			this.sceneType = (SceneType)sceneData.type;
			SceneType sceneType = this.sceneType;
			if (sceneType <= SceneType.SCENE_TOWER)
			{
				if (sceneType != SceneType.SCENE_BATTLE)
				{
					switch (sceneType)
					{
					case SceneType.SCENE_WORLDBOSS:
					case SceneType.SCENE_GUILD_BOSS:
						base.uiBehaviour.m_WorldBossHandler.SetVisible(true);
						break;
					case (SceneType)8:
					case SceneType.SCENE_BOSSRUSH:
					case SceneType.SCENE_GUILD_HALL:
						break;
					case SceneType.SCENE_PK:
					{
						XQualifyingDocument specificDocument4 = XDocuments.GetSpecificDocument<XQualifyingDocument>(XQualifyingDocument.uuID);
						bool flag5 = specificDocument4.PkInfoList.Count > 0;
						if (flag5)
						{
							this.SetEnemyRoleInfo(specificDocument4.PkInfoList[0].brief.roleName, specificDocument4.PkInfoList[0].brief.roleLevel);
						}
						break;
					}
					case SceneType.SCENE_ABYSSS:
						break;
					default:
						if (sceneType == SceneType.SCENE_TOWER)
						{
							base.uiBehaviour.m_TeamTowerHandler.SetVisible(true);
						}
						break;
					}
				}
			}
			else if (sceneType <= SceneType.SCENE_GUILD_CAMP)
			{
				switch (sceneType)
				{
				case SceneType.SCENE_GODDESS:
				case SceneType.SCENE_ENDLESSABYSS:
					this.GetTeamLeftTimes();
					break;
				case SceneType.SCENE_DRAGON_EXP:
					break;
				case SceneType.SCENE_RISK:
					break;
				default:
					if (sceneType != SceneType.SCENE_GUILD_CAMP)
					{
					}
					break;
				}
			}
			else if (sceneType != SceneType.SCENE_INVFIGHT)
			{
				if (sceneType == SceneType.SCENE_CASTLE_WAIT)
				{
					base.uiBehaviour.m_SkillHandler.SetVisible(false);
				}
			}
			else
			{
				XPKInvitationDocument specificDocument5 = XDocuments.GetSpecificDocument<XPKInvitationDocument>(XPKInvitationDocument.uuID);
				bool flag6 = specificDocument5.PKInfoList.Count > 0;
				if (flag6)
				{
					this.SetEnemyRoleInfo(specificDocument5.PKInfoList[0].roleName, specificDocument5.PKInfoList[0].roleLevel);
				}
			}
			this.SetWinConditionTips();
			this.SetBattleExplainTips();
			XPlayerAttributes xplayerAttributes2 = XSingleton<XEntityMgr>.singleton.Player.Attributes as XPlayerAttributes;
			bool flag7 = XSingleton<XSceneMgr>.singleton.CanAutoPlay(XSingleton<XScene>.singleton.SceneID);
			bool flag8 = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level < uint.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("AutoPlayUnlockLevel"));
			base.uiBehaviour.m_AutoPlayContent.SetActive(flag7);
			bool flag9 = flag7;
			if (flag9)
			{
				this._can_auto_play = true;
				bool flag10 = flag8;
				if (flag10)
				{
					base.uiBehaviour.m_AutoPlayBorad.SetVisible(true);
					base.uiBehaviour.m_AutoPlay.SetEnable(false, false);
					base.uiBehaviour.m_AutoPlayLock.SetVisible(true);
				}
				else
				{
					bool flag11 = this.sceneType == SceneType.SCENE_GODDESS;
					if (flag11)
					{
						base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(true);
					}
					else
					{
						bool autoPlayOn = xplayerAttributes2.AutoPlayOn;
						if (autoPlayOn)
						{
							base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(true);
						}
						else
						{
							base.uiBehaviour.m_AutoPlayBorad.SetVisible(true);
						}
					}
					base.uiBehaviour.m_AutoPlayLock.SetVisible(false);
					base.uiBehaviour.m_AutoPlay.SetEnable(true, false);
				}
			}
			else
			{
				this._can_auto_play = false;
				xplayerAttributes2.AutoPlayOn = false;
			}
			SceneType sceneType2 = this.sceneType;
			if (sceneType2 != SceneType.SCENE_ARENA && sceneType2 != SceneType.SCENE_PK && sceneType2 != SceneType.SCENE_INVFIGHT)
			{
				this.EnemyInfoHandler.InitBoss();
			}
			else
			{
				this.EnemyInfoHandler.InitRole();
			}
			XTeamDocument specificDocument6 = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			bool flag12 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_PVP;
			if (flag12)
			{
				XBattleCaptainPVPDocument specificDocument7 = XDocuments.GetSpecificDocument<XBattleCaptainPVPDocument>(XBattleCaptainPVPDocument.uuID);
				this.TeamMonitor.InitWhenShowMainUIByBloodList(specificDocument7.TeamBlood);
			}
			else
			{
				bool flag13 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HEROBATTLE;
				if (flag13)
				{
					XHeroBattleDocument specificDocument8 = XDocuments.GetSpecificDocument<XHeroBattleDocument>(XHeroBattleDocument.uuID);
					this.TeamMonitor.InitWhenShowMainUIByBloodList(specificDocument8.TeamBlood);
				}
				else
				{
					bool flag14 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_CRAZYBOMB || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_GHOSTACTION || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_HORSERACING || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_LIVECHALLENGE || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_MONSTERFIGHT || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_DUCK;
					if (flag14)
					{
						XWeekendPartyDocument specificDocument9 = XDocuments.GetSpecificDocument<XWeekendPartyDocument>(XWeekendPartyDocument.uuID);
						this.TeamMonitor.InitWhenShowMainUIByBloodList(specificDocument9.TeamBlood);
					}
					else
					{
						this.TeamMonitor.InitWhenShowMainUIByTeam(specificDocument6.MyTeam);
					}
				}
			}
			bool flag15 = XSingleton<XScene>.singleton.SceneID != 100U && XSingleton<XScene>.singleton.SceneType != SceneType.SCENE_CALLBACK && (ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level >= (ulong)((long)int.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("ShowChatLevelBattle")));
			if (flag15)
			{
				ShowSettingArgs showSettingArgs = new ShowSettingArgs();
				showSettingArgs.position = 2;
				showSettingArgs.showsettings = false;
				showSettingArgs.enablebackclick = true;
				showSettingArgs.enabledrag = false;
				DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.ShowChatMiniUI(showSettingArgs);
			}
			base.uiBehaviour.m_StrengthPresevedBar.SetVisible(this._doc.ShowStrengthPresevedBar);
			this.RefreshYuyin();
			this.InitView();
			bool flag16 = this.apolloDoc != null;
			if (flag16)
			{
				this.apolloDoc.RequestJoinRoom();
			}
			bool flag17 = XSingleton<XScene>.singleton.SceneType == SceneType.SKYCITY_FIGHTING || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_BIGMELEE_FIGHT;
			if (flag17)
			{
				base.uiBehaviour.m_SkyAreanStage.gameObject.SetActive(true);
			}
			else
			{
				base.uiBehaviour.m_SkyAreanStage.gameObject.SetActive(false);
			}
			bool flag18 = (ulong)XSingleton<XScene>.singleton.SceneID == (ulong)((long)int.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("GuildCampHorseSceneID")));
			if (flag18)
			{
				base.uiBehaviour.m_HorseRide.gameObject.SetActive(true);
			}
			else
			{
				base.uiBehaviour.m_HorseRide.gameObject.SetActive(false);
			}
			base.uiBehaviour.m_GuildMineBuff.gameObject.SetActive(false);
			base.uiBehaviour.m_pauseGroup.SetGroup((XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_MOBA) ? 1 : 0);
			base.uiBehaviour.m_3D25D.gameObject.SetActive(XSingleton<XScene>.singleton.SceneType != SceneType.SCENE_MOBA);
			base.uiBehaviour.m_BtnDamageStatistics.SetVisible(sceneData.ShowBattleStatistics);
			base.uiBehaviour.m_Menu.Refresh();
		}

		// Token: 0x06010A8D RID: 68237 RVA: 0x004234F7 File Offset: 0x004216F7
		private void InitView()
		{
			this.SetView(XSingleton<XOperationData>.singleton.OperationMode);
		}

		// Token: 0x06010A8E RID: 68238 RVA: 0x0042350C File Offset: 0x0042170C
		public void SetView(XOperationMode mode)
		{
			bool flag = base.uiBehaviour == null || base.uiBehaviour.m_SightPic == null || base.uiBehaviour.m_SelectPic == null || base.uiBehaviour.m_SightSelect == null;
			if (!flag)
			{
				switch (mode)
				{
				case XOperationMode.X25D:
					base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_1");
					base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_1");
					break;
				case XOperationMode.X3D:
					base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_0");
					base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_0");
					break;
				case XOperationMode.X3D_Free:
					base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_2");
					base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_2");
					break;
				}
				base.uiBehaviour.m_SightPic.MakePixelPerfect();
				base.uiBehaviour.m_SelectPic.MakePixelPerfect();
				base.uiBehaviour.m_SightSelect.gameObject.SetActive(false);
			}
		}

		// Token: 0x06010A8F RID: 68239 RVA: 0x00423643 File Offset: 0x00421843
		private void SetStartAutoPlay()
		{
			this.SetAutoPlay(true);
		}

		// Token: 0x06010A90 RID: 68240 RVA: 0x00423650 File Offset: 0x00421850
		private void GetTeamLeftTimes()
		{
			XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			specificDocument.ReqTeamOp(TeamOperate.TEAM_QUERYCOUNT, 0UL, null, TeamMemberType.TMT_NORMAL, null);
		}

		// Token: 0x06010A91 RID: 68241 RVA: 0x00423678 File Offset: 0x00421878
		private void SetWinConditionTips()
		{
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag = sceneData == null || string.IsNullOrEmpty(sceneData.WinConditionTips);
			if (flag)
			{
				base.uiBehaviour.m_winConditionTips.SetVisible(false);
			}
			else
			{
				base.uiBehaviour.m_winConditionTips.SetVisible(true);
				string text = sceneData.WinConditionTips.Replace("/n", "\n");
				base.uiBehaviour.m_winConditionTips.SetText(text);
			}
		}

		// Token: 0x06010A92 RID: 68242 RVA: 0x00423700 File Offset: 0x00421900
		private void SetBattleExplainTips()
		{
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag = sceneData == null || string.IsNullOrEmpty(sceneData.BattleExplainTips);
			if (flag)
			{
				base.uiBehaviour.m_BattleExplainTips.SetVisible(false);
			}
			else
			{
				base.uiBehaviour.m_BattleExplainTips.SetVisible(true);
				string text = XSingleton<UiUtility>.singleton.ReplaceReturn(sceneData.BattleExplainTips);
				base.uiBehaviour.m_BattleExplainTips.SetText(text);
			}
		}

		// Token: 0x06010A93 RID: 68243 RVA: 0x00423784 File Offset: 0x00421984
		public void SetTeamLeftTimes()
		{
			base.uiBehaviour.m_leftTimes.SetVisible(true);
			XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag = sceneData.type == 20;
			if (flag)
			{
				int dayCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelGoddessTrial, null);
				int dayMaxCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelGoddessTrial, null);
				base.uiBehaviour.m_leftTimes.SetText(string.Format("{0}({1}/{2})", XStringDefineProxy.GetString("GODDESS_NAME"), dayMaxCount - dayCount, dayMaxCount));
			}
			else
			{
				bool flag2 = sceneData.type == 23;
				if (flag2)
				{
					int dayCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelEndlessAbyss, null);
					int dayMaxCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelEndlessAbyss, null);
					base.uiBehaviour.m_leftTimes.SetText(string.Format("{0}({1}/{2})", XStringDefineProxy.GetString("EndlessAbyss"), dayMaxCount - dayCount, dayMaxCount));
				}
				else
				{
					base.uiBehaviour.m_leftTimes.SetVisible(false);
				}
			}
		}

		// Token: 0x06010A94 RID: 68244 RVA: 0x00423890 File Offset: 0x00421A90
		protected override void OnLoad()
		{
			this._maxHP = 0;
			this._currentHP = 0;
			this._maxMP = 0;
			this._currentMP = 0;
			base.OnLoad();
			DlgHandlerBase.EnsureCreate<XYuyinView>(ref this._yuyinHandler, base.uiBehaviour.transform, true, this);
		}

		// Token: 0x06010A95 RID: 68245 RVA: 0x004238D0 File Offset: 0x00421AD0
		protected override void OnHide()
		{
			base.uiBehaviour.m_SkillHandler.SetVisible(false);
			bool flag = DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.IsLoaded();
			if (flag)
			{
				DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.SetVisible(false, true);
			}
			bool flag2 = DlgBase<BroadMiniDlg, BroadcastMiniBehaviour>.singleton.IsLoaded();
			if (flag2)
			{
				DlgBase<BroadMiniDlg, BroadcastMiniBehaviour>.singleton.Show(false);
			}
			bool flag3 = DlgBase<RadioBattleDlg, RadioBattleBahaviour>.singleton.IsLoaded();
			if (flag3)
			{
				DlgBase<RadioBattleDlg, RadioBattleBahaviour>.singleton.Show(false);
			}
			bool flag4 = DlgBase<XChatView, XChatBehaviour>.singleton.IsLoaded();
			if (flag4)
			{
				DlgBase<XChatView, XChatBehaviour>.singleton.SetVisible(false, true);
			}
			this._maxHP = 0;
			this._currentHP = 0;
			this._maxMP = 0;
			this._currentMP = 0;
			base.OnHide();
		}

		// Token: 0x06010A96 RID: 68246 RVA: 0x00423980 File Offset: 0x00421B80
		protected override void OnUnload()
		{
			this.m_uiBehaviour.m_txtHead.SetTexturePath("");
			DlgHandlerBase.EnsureUnload<BattleShowInfoHandler>(ref this.m_BattleShowInfoHandler);
			DlgHandlerBase.EnsureUnload<BattleCaptainPVPHandler>(ref this.m_BattleCaptainPVPHandler);
			DlgHandlerBase.EnsureUnload<GuildMinePVPBattleHandler>(ref this.m_GuildMinePVPBattleHandler);
			DlgHandlerBase.EnsureUnload<GuildMinePVPInfoHandler>(ref this.m_GuildMinePVPInfoHandler);
			DlgHandlerBase.EnsureUnload<SkyArenaBattleHandler>(ref this.m_SkyArenaBattleHandler);
			DlgHandlerBase.EnsureUnload<SkyArenaInfoHandler>(ref this.m_SkyArenaInfoHandler);
			DlgHandlerBase.EnsureUnload<AbyssPartyBattleHandler>(ref this.m_AbyssPartyBattleHandler);
			DlgHandlerBase.EnsureUnload<BigMeleeBattleHandler>(ref this.m_BigMeleeBattleHandler);
			DlgHandlerBase.EnsureUnload<BattleFieldBattleHandler>(ref this.m_BattleFieldBattleHandler);
			DlgHandlerBase.EnsureUnload<XOptionsBattleHandler>(ref this.m_XOptionBattleHandler);
			DlgHandlerBase.EnsureUnload<RaceBattleHandler>(ref this.m_RaceBattleHandler);
			DlgHandlerBase.EnsureUnload<BattleWorldBossHandler>(ref base.uiBehaviour.m_WorldBossHandler);
			DlgHandlerBase.EnsureUnload<BattleSkillHandler>(ref base.uiBehaviour.m_SkillHandler);
			DlgHandlerBase.EnsureUnload<BattleIndicateHandler>(ref base.uiBehaviour.m_IndicateHandler);
			DlgHandlerBase.EnsureUnload<XTeamMonitorHandler>(ref base.uiBehaviour.m_TeamMonitor);
			DlgHandlerBase.EnsureUnload<XBattleEnemyInfoHandler>(ref base.uiBehaviour.m_EnemyInfoHandler);
			DlgHandlerBase.EnsureUnload<XBuffMonitorHandler>(ref base.uiBehaviour.m_PlayerBuffMonitorHandler);
			DlgHandlerBase.EnsureUnload<ProfressionTrialsHandler>(ref this.ProfTrialsHandler);
			DlgHandlerBase.EnsureUnload<BattleDpsHandler>(ref this.m_DpsHandler);
			DlgHandlerBase.EnsureUnload<XYuyinView>(ref this._yuyinHandler);
			DlgHandlerBase.EnsureUnload<HeroBattleSkillHandler>(ref this.m_HeroBattleSkillHandler);
			DlgHandlerBase.EnsureUnload<HeroBattleHandler>(ref this.m_HeroBattleHandler);
			DlgHandlerBase.EnsureUnload<MobaBattleHandler>(ref this.m_MobaBattleHandler);
			DlgHandlerBase.EnsureUnload<GuildMiniReportHandler>(ref this.m_miniReportHandler);
			DlgHandlerBase.EnsureUnload<GuildBattleMiniRankHandler>(ref this.m_miniRankHandler);
			DlgHandlerBase.EnsureUnload<BattleRiftHandler>(ref this.m_riftHandler);
			DlgHandlerBase.EnsureUnload<WeekendPartyHandler>(ref this.m_WeekendPartyHandler);
			DlgHandlerBase.EnsureUnload<BattleStatisticsHandler>(ref this.m_BattleStatisticsHandler);
			this._doc.BattleMainView = null;
			bool flag = this.apolloDoc != null;
			if (flag)
			{
				this.apolloDoc.QuitRoom();
			}
			this.ClearBigNotice();
			base.OnUnload();
		}

		// Token: 0x06010A97 RID: 68247 RVA: 0x00423B48 File Offset: 0x00421D48
		private void RefreshYuyin()
		{
			this.type = XFastEnumIntEqualityComparer<SceneType>.ToInt(XSingleton<XScene>.singleton.SceneType);
			bool flag = this._yuyinHandler != null;
			if (flag)
			{
				this._yuyinHandler.Refresh(this.type);
			}
		}

		// Token: 0x06010A98 RID: 68248 RVA: 0x00423B8C File Offset: 0x00421D8C
		public void RefreshYuyin(ulong uid)
		{
			bool flag = this._yuyinHandler != null;
			if (flag)
			{
				this._yuyinHandler.Refresh(this.type);
			}
		}

		// Token: 0x06010A99 RID: 68249 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		private void SetEnemyRoleInfo(string name, uint level)
		{
		}

		// Token: 0x06010A9A RID: 68250 RVA: 0x00423BBC File Offset: 0x00421DBC
		private bool OnTailToBackClick(IXUIButton go)
		{
			XSingleton<XScene>.singleton.GameCamera.Tail.TailToBack();
			return true;
		}

		// Token: 0x06010A9B RID: 68251 RVA: 0x00423BE4 File Offset: 0x00421DE4
		private bool OnPauseClick(IXUIButton go)
		{
			bool flag = !base.IsLoaded();
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
				bool flag2 = sceneData != null;
				if (flag2)
				{
					bool canPause = sceneData.CanPause;
					if (canPause)
					{
						XSingleton<XShell>.singleton.Pause = true;
					}
				}
				bool flag3 = this.m_XOptionBattleHandler == null;
				if (flag3)
				{
					bool flag4 = base.uiBehaviour != null;
					if (flag4)
					{
						DlgHandlerBase.EnsureCreate<XOptionsBattleHandler>(ref this.m_XOptionBattleHandler, base.uiBehaviour.m_canvas, true, this);
					}
				}
				bool flag5 = this.m_XOptionBattleHandler != null && !this.m_XOptionBattleHandler.IsVisible();
				if (flag5)
				{
					this.m_XOptionBattleHandler.ShowUI();
				}
				this.sceneType = XSingleton<XScene>.singleton.SceneType;
				result = true;
			}
			return result;
		}

		// Token: 0x06010A9C RID: 68252 RVA: 0x00423CBC File Offset: 0x00421EBC
		private void OnAvatarClick(IXUISprite go)
		{
			bool flag = !base.IsLoaded();
			if (!flag)
			{
				bool flag2 = DlgBase<DemoUI, DemoUIBehaviour>.singleton.IsVisible();
				DlgBase<DemoUI, DemoUIBehaviour>.singleton.SetVisible(!flag2, true);
			}
		}

		// Token: 0x06010A9D RID: 68253 RVA: 0x00423CF8 File Offset: 0x00421EF8
		public void SetTencentImage()
		{
			bool flag = XSingleton<PDatabase>.singleton.playerInfo != null;
			if (flag)
			{
				string pictureLarge = XSingleton<PDatabase>.singleton.playerInfo.data.pictureLarge;
				XSingleton<XUICacheImage>.singleton.Load(pictureLarge, this.m_uiBehaviour.m_txtHead, this.m_uiBehaviour);
			}
			else
			{
				XSingleton<XUICacheImage>.singleton.Load(string.Empty, this.m_uiBehaviour.m_txtHead, this.m_uiBehaviour);
			}
			XPrerogativeDocument specificDocument = XDocuments.GetSpecificDocument<XPrerogativeDocument>(XPrerogativeDocument.uuID);
			XSingleton<UiUtility>.singleton.ParseHeadIcon(specificDocument.PlayerSetid, base.uiBehaviour.m_sprFrame);
		}

		// Token: 0x06010A9E RID: 68254 RVA: 0x00423D98 File Offset: 0x00421F98
		private bool OnBussrushPauseClick(IXUIButton btn)
		{
			XSingleton<XScene>.singleton.ReqLeaveScene();
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetVisible(false, true);
			return true;
		}

		// Token: 0x06010A9F RID: 68255 RVA: 0x00423DC4 File Offset: 0x00421FC4
		public void ShowBossrushQuit()
		{
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetVisible(true, true);
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetSingleButtonMode(false);
			string @string = XStringDefineProxy.GetString("BOSSRUSH_QUIT");
			string string2 = XStringDefineProxy.GetString("COMMON_OK");
			string string3 = XStringDefineProxy.GetString("COMMON_CANCEL");
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetLabelsWithSymbols(@string, string2, string3);
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetModalCallback(new ButtonClickEventHandler(this.OnBussrushPauseClick), null);
		}

		// Token: 0x06010AA0 RID: 68256 RVA: 0x00423E34 File Offset: 0x00422034
		private void UpdatePlayerInfo()
		{
			XPlayerAttributes xplayerData = XSingleton<XAttributeMgr>.singleton.XPlayerData;
			bool flag = xplayerData != null;
			if (flag)
			{
				int num = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_MaxHP_Total);
				int num2 = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_CurrentHP_Basic);
				int num3 = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_MaxMP_Total);
				int num4 = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_CurrentMP_Basic);
				bool flag2 = num2 < 0;
				if (flag2)
				{
					num2 = 0;
				}
				float num5 = (float)num2 / (float)num;
				base.uiBehaviour.m_Hpbar.SetFillAmount(num5);
				float fillAmount = (float)num4 / (float)num3;
				base.uiBehaviour.m_Mpbar.SetFillAmount(fillAmount);
				bool flag3 = this._currentHP != num2 || this._maxHP != num;
				if (flag3)
				{
					base.uiBehaviour.m_HpText.SetText(string.Format("{0}/{1}", num2, num));
					this._currentHP = num2;
					this._maxHP = num;
				}
				bool flag4 = this._currentMP != num4 || this._maxMP != num3;
				if (flag4)
				{
					base.uiBehaviour.m_MpText.SetText(string.Format("{0}/{1}", num4, num3));
					this._currentMP = num4;
					this._maxMP = num3;
				}
				Color color;
				bool active;
				BattleMain.GetHPColor(num5, out color, out active);
				base.uiBehaviour.m_LowHP.SetActive(active);
			}
		}

		// Token: 0x06010AA1 RID: 68257 RVA: 0x00423F9C File Offset: 0x0042219C
		public static void GetHPColor(float hpPercent, out Color color, out bool bLowHP)
		{
			bool flag = hpPercent > BattleMain._fYellow;
			if (flag)
			{
				color = BattleMain._hp_green;
				bLowHP = false;
			}
			else
			{
				bool flag2 = hpPercent <= BattleMain._fYellow && hpPercent > BattleMain._fRed;
				if (flag2)
				{
					color = BattleMain._hp_yellow;
					bLowHP = false;
				}
				else
				{
					color = BattleMain._hp_red;
					bLowHP = true;
				}
			}
		}

		// Token: 0x06010AA2 RID: 68258 RVA: 0x00424010 File Offset: 0x00422210
		public void OnPlayerBuffChange()
		{
			base.uiBehaviour.m_PlayerBuffMonitorHandler.OnBuffChanged(XSingleton<XEntityMgr>.singleton.Player.Buffs.GetUIBuffList());
		}

		// Token: 0x06010AA3 RID: 68259 RVA: 0x00424038 File Offset: 0x00422238
		public override void OnUpdate()
		{
			base.uiBehaviour.m_SkillHandler.OnUpdate();
			bool flag = !XSingleton<XTimerMgr>.singleton.NeedFixedUpdate;
			if (!flag)
			{
				base.OnUpdate();
				bool flag2 = this.lastDebugUITrigger > 0f;
				if (flag2)
				{
					this.lastDebugUITrigger -= Time.deltaTime;
				}
				bool flag3 = this.lastDebugUITrigger <= 0f && Input.GetKey((KeyCode)285);
				if (flag3)
				{
					DlgBase<DemoUI, DemoUIBehaviour>.singleton.Toggle();
					this.lastDebugUITrigger = 0.05f;
				}
				bool key = Input.GetKey((KeyCode)96);
				if (key)
				{
					bool flag4 = Input.GetKey((KeyCode)256) || Input.GetKey((KeyCode)48);
					if (flag4)
					{
						XSingleton<XCommand>.singleton.CustomCommand(0);
					}
					bool flag5 = Input.GetKey((KeyCode)257) || Input.GetKey((KeyCode)49);
					if (flag5)
					{
						XSingleton<XCommand>.singleton.CustomCommand(1);
					}
					bool flag6 = Input.GetKey((KeyCode)258) || Input.GetKey((KeyCode)50);
					if (flag6)
					{
						XSingleton<XCommand>.singleton.CustomCommand(2);
					}
					bool flag7 = Input.GetKey((KeyCode)259) || Input.GetKey((KeyCode)51);
					if (flag7)
					{
						XSingleton<XCommand>.singleton.CustomCommand(3);
					}
					bool flag8 = Input.GetKey((KeyCode)260) || Input.GetKey((KeyCode)52);
					if (flag8)
					{
						XSingleton<XCommand>.singleton.CustomCommand(4);
					}
					bool flag9 = Input.GetKey((KeyCode)261) || Input.GetKey((KeyCode)53);
					if (flag9)
					{
						XSingleton<XCommand>.singleton.CustomCommand(5);
					}
					bool flag10 = Input.GetKey((KeyCode)262) || Input.GetKey((KeyCode)54);
					if (flag10)
					{
						XSingleton<XCommand>.singleton.CustomCommand(6);
					}
					bool flag11 = Input.GetKey((KeyCode)263) || Input.GetKey((KeyCode)55);
					if (flag11)
					{
						XSingleton<XCommand>.singleton.CustomCommand(7);
					}
					bool flag12 = Input.GetKey((KeyCode)264) || Input.GetKey((KeyCode)56);
					if (flag12)
					{
						XSingleton<XCommand>.singleton.CustomCommand(8);
					}
					bool flag13 = Input.GetKey((KeyCode)265) || Input.GetKey((KeyCode)57);
					if (flag13)
					{
						XSingleton<XCommand>.singleton.CustomCommand(9);
					}
				}
				this.UpdatePlayerInfo();
				this.UpdateWifi();
				bool flag14 = Time.unscaledTime - this.lastPingTime > 60f || this.lastPingTime < 0f;
				if (flag14)
				{
					this.RefreshPing();
					this.lastPingTime = Time.unscaledTime;
				}
				base.uiBehaviour.m_IndicateHandler.OnUpdate();
				bool flag15 = Time.time - this._last_check_time > 5f;
				if (flag15)
				{
					this._last_check_time = Time.time;
					this._doc.SendCheckTime();
				}
				this.UpdateTime();
				this.UpdateLeftTime();
				bool flag16 = this.NoticeTime > 0f;
				if (flag16)
				{
					bool flag17 = Time.time - this.NoticeTime > this._notice_duration;
					if (flag17)
					{
						base.uiBehaviour.m_NoticeFrame.transform.localPosition = XGameUI.Far_Far_Away;
						this.NoticeTime = 0f;
					}
				}
				bool active = base.uiBehaviour.m_WorldBossHandler.active;
				if (active)
				{
					base.uiBehaviour.m_WorldBossHandler.OnUpdate();
				}
// 				IXGameSirControl gameSirControl = XSingleton<XUpdater.XUpdater>.singleton.GameSirControl;
// 				bool flag18 = gameSirControl != null && gameSirControl.IsConnected() && gameSirControl.GetButton(XGameSirKeyCode.BTN_THUMBR);
// 				if (flag18)
// 				{
// 					XOptionsDocument specificDocument = XDocuments.GetSpecificDocument<XOptionsDocument>(XOptionsDocument.uuID);
// 					int num = specificDocument.GetValue(XOptionsDefine.OD_VIEW) + 1;
// 					int num2 = XFastEnumIntEqualityComparer<XOperationMode>.ToInt(XOperationMode.X3D_Free);
// 					bool flag19 = num > num2;
// 					if (flag19)
// 					{
// 						num = XFastEnumIntEqualityComparer<XOperationMode>.ToInt(XOperationMode.X25D);
// 					}
// 					specificDocument.SetValue(XOptionsDefine.OD_VIEW, num, false);
// 					specificDocument.SetBattleOptionValue();
// 					this.SetView((XOperationMode)num);
// 				}
				this.TeamMonitor.OnUpdate();
				this.EnemyInfoHandler.OnUpdate();
				base.uiBehaviour.m_PlayerBuffMonitorHandler.OnUpdate();
				bool flag20 = this._combo_buff_to_add > this._combo_buff_added;
				if (flag20)
				{
					ComboBuff comboBuff = this._combo_buff_list[this._combo_buff_to_add];
					XBuff buffByID = XSingleton<XEntityMgr>.singleton.Player.Buffs.GetBuffByID(comboBuff.buffID);
					bool flag21 = buffByID != null;
					if (flag21)
					{
						this._combo_buff_added = this._combo_buff_to_add;
						this._combo_buff_to_add = -1;
					}
				}
				bool flag22 = this._combo_buff_added >= 0;
				if (flag22)
				{
					ComboBuff comboBuff2 = this._combo_buff_list[this._combo_buff_added];
					XBuff buffByID2 = XSingleton<XEntityMgr>.singleton.Player.Buffs.GetBuffByID(comboBuff2.buffID);
					bool flag23 = buffByID2 != null;
					if (flag23)
					{
						float leftTime = buffByID2.GetLeftTime();
						Color comboQuality = this.GetComboQuality(this._combo_buff_added + 1);
						base.uiBehaviour.m_ComboBuffName.SetText(comboBuff2.buffName);
						base.uiBehaviour.m_ComboBuffName.SetColor(comboQuality);
						base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(true);
						bool flag24 = leftTime != -1f;
						if (flag24)
						{
							base.uiBehaviour.m_ComboBuffTime.value = leftTime / buffByID2.Duration;
						}
						else
						{
							base.uiBehaviour.m_ComboBuffTime.value = 1f;
						}
					}
					else
					{
						this._combo_buff_added = -1;
						base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false);
					}
				}
				else
				{
					base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false);
				}
				bool flag25 = base.uiBehaviour.m_StrengthPresevedBar.IsVisible();
				if (flag25)
				{
					this.RefreshStrengthPresevedBar();
				}
			}
		}

		// Token: 0x06010AA4 RID: 68260 RVA: 0x004245FC File Offset: 0x004227FC
		protected Color GetComboQuality(int quality)
		{
			Color result;
			switch (quality)
			{
			case 1:
				result = new Color32(0, byte.MaxValue, 18, byte.MaxValue);
				break;
			case 2:
				result = new Color32(0, 228, byte.MaxValue, byte.MaxValue);
				break;
			case 3:
				result = new Color32(byte.MaxValue, 180, 0, byte.MaxValue);
				break;
			case 4:
				result = new Color32(252, 0, byte.MaxValue, byte.MaxValue);
				break;
			default:
				result = new Color32(252, 0, byte.MaxValue, byte.MaxValue);
				break;
			}
			return result;
		}

		// Token: 0x06010AA5 RID: 68261 RVA: 0x004246B5 File Offset: 0x004228B5
		private void UpdateWifi()
		{
			XSingleton<UiUtility>.singleton.UpdateWifi(null, this.m_uiBehaviour.m_sprwifi);
		}

		// Token: 0x06010AA6 RID: 68262 RVA: 0x004246CF File Offset: 0x004228CF
		private void RefreshPing()
		{
			XSingleton<UiUtility>.singleton.RefreshPing(base.uiBehaviour.m_lblTime, base.uiBehaviour.m_sliderBattery, base.uiBehaviour.m_lblfree);
		}

		// Token: 0x06010AA7 RID: 68263 RVA: 0x00424700 File Offset: 0x00422900
		public void RefreshBossRush()
		{
			XBossBushDocument xbossBushDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XBossBushDocument.uuID) as XBossBushDocument;
			bool flag = xbossBushDocument != null && XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_BOSSRUSH;
			if (flag)
			{
				this.m_uiBehaviour.m_sprBuff1.SetSprite(xbossBushDocument.bossBuff1Row.icon);
				this.m_uiBehaviour.m_sprBuff2.SetSprite(xbossBushDocument.bossBuff2Row.icon);
				this.m_uiBehaviour.m_lblBuff1.SetText(xbossBushDocument.bossBuff1Row.Comment);
				this.m_uiBehaviour.m_lblBuff2.SetText(xbossBushDocument.bossBuff2Row.Comment);
				int quality = xbossBushDocument.bossBuff1Row.Quality;
				int quality2 = xbossBushDocument.bossBuff2Row.Quality;
				string value = XSingleton<XGlobalConfig>.singleton.GetValue("Quality" + quality + "Color");
				string value2 = XSingleton<XGlobalConfig>.singleton.GetValue("Quality" + quality2 + "Color");
				this.m_uiBehaviour.m_sprBuff1.SetColor(XSingleton<UiUtility>.singleton.ParseColor(value, 0));
				this.m_uiBehaviour.m_sprBuff2.SetColor(XSingleton<UiUtility>.singleton.ParseColor(value2, 0));
				this.m_uiBehaviour.m_lblBuff1.SetColor(XSingleton<UiUtility>.singleton.ParseColor(value, 0));
				this.m_uiBehaviour.m_lblBuff2.SetColor(XSingleton<UiUtility>.singleton.ParseColor(value2, 0));
				base.uiBehaviour.m_lblTitle.SetText(XStringDefineProxy.GetString("BOSSRUSH_FIGHT", new object[]
				{
					xbossBushDocument.respData.currank
				}) + "  " + DlgBase<BossRushDlg, BossRushBehavior>.singleton.bossName);
				base.uiBehaviour.m_rwdpool.ReturnAll(false);
				for (int i = 0; i < xbossBushDocument.bossRushRow.reward.Count; i++)
				{
					uint itemid = xbossBushDocument.bossRushRow.reward[i, 0];
					uint num = xbossBushDocument.bossRushRow.reward[i, 1];
					GameObject gameObject = base.uiBehaviour.m_rwdpool.FetchGameObject(false);
					XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(gameObject, (int)itemid, (int)(num * xbossBushDocument.rwdRate), false);
					bool flag2 = i < 2;
					if (flag2)
					{
						gameObject.transform.localPosition = new Vector3((float)(10 + 100 * i), 0f, 0f);
					}
					else
					{
						gameObject.transform.localPosition = new Vector3((float)(10 + 100 * (i - 2)), -100f, 0f);
					}
				}
				base.uiBehaviour.m_sprBossbg.spriteHeight = ((xbossBushDocument.bossRushRow.reward.Count > 2) ? 207 : 137);
			}
		}

		// Token: 0x06010AA8 RID: 68264 RVA: 0x004249F8 File Offset: 0x00422BF8
		public void UpdateKill(int cnt)
		{
			bool flag = base.IsVisible();
			if (flag)
			{
				string @string = XStringDefineProxy.GetString("SMALLMONSTER_KILL");
				base.uiBehaviour.m_lblKill.SetText(string.Format(XStringDefineProxy.GetString("SMALLMONSTER_KILL"), cnt));
			}
		}

		// Token: 0x06010AA9 RID: 68265 RVA: 0x00424A44 File Offset: 0x00422C44
		public void OnComboChange(uint combo)
		{
			bool flag = combo > 0U;
			if (flag)
			{
				this.m_uiBehaviour.m_ComboFrame.transform.localPosition = Vector3.zero;
				this.m_uiBehaviour.m_ComboText.SetText(combo.ToString());
				IXUITweenTool comboBgTween = this.m_uiBehaviour.m_ComboBgTween;
				comboBgTween.PlayTween(true, -1f);
				bool hasComboBuff = XSingleton<XScene>.singleton.SceneData.HasComboBuff;
				if (hasComboBuff)
				{
					int num = -1;
					bool flag2 = (ulong)combo < (ulong)((long)this._combo_buff_list[0].combo);
					if (flag2)
					{
						num = -1;
					}
					else
					{
						bool flag3 = (ulong)combo > (ulong)((long)this._combo_buff_list[this._combo_buff_list.Count - 1].combo);
						if (flag3)
						{
							num = -1;
						}
						else
						{
							for (int i = 0; i < this._combo_buff_list.Count - 1; i++)
							{
								bool flag4 = (ulong)combo == (ulong)((long)this._combo_buff_list[i].combo);
								if (flag4)
								{
									num = i;
									break;
								}
							}
						}
					}
					bool flag5 = num >= 0 && num <= this._combo_buff_list.Count - 1;
					if (flag5)
					{
						XBuffAddEventArgs @event = XEventPool<XBuffAddEventArgs>.GetEvent();
						@event.xBuffDesc.BuffID = this._combo_buff_list[num].buffID;
						@event.xBuffDesc.BuffLevel = this._combo_buff_list[num].buffLevel;
						@event.Firer = XSingleton<XEntityMgr>.singleton.Player;
						@event.xBuffDesc.CasterID = XSingleton<XEntityMgr>.singleton.Player.ID;
						XSingleton<XEventMgr>.singleton.FireEvent(@event);
						this._combo_buff_to_add = num;
					}
					else
					{
						base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false);
					}
				}
				else
				{
					base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false);
				}
			}
			else
			{
				this.m_uiBehaviour.m_ComboFrame.transform.localPosition = Vector3.one * (float)XGameUI._far_far_away;
			}
		}

		// Token: 0x06010AAA RID: 68266 RVA: 0x00424C68 File Offset: 0x00422E68
		public void ShowNotice(string text, float duration, float pertime = 1f)
		{
			this._notice_collection.Clear();
			string[] array = text.Split(XGlobalConfig.ListSeparator);
			for (int i = 0; i < array.Length; i++)
			{
				this._notice_collection.Add(array[i]);
			}
			this._notice_duration = duration;
			this._notice_pertime = pertime;
			bool flag = this.time_token > 0U;
			if (flag)
			{
				XSingleton<XTimerMgr>.singleton.KillTimer(this.time_token);
				this.time_token = 0U;
			}
			bool flag2 = this._notice_collection.Count > 0;
			if (flag2)
			{
				this.ShowSingleNotice(0);
			}
		}

		// Token: 0x06010AAB RID: 68267 RVA: 0x00424D08 File Offset: 0x00422F08
		protected void ShowSingleNotice(object o)
		{
			int num = (int)o;
			bool flag = num < this._notice_collection.Count;
			if (flag)
			{
				string text = this._notice_collection[num];
				base.uiBehaviour.m_Notice.SetText(text);
				base.uiBehaviour.m_NoticeFrame.transform.localPosition = base.uiBehaviour.m_NoticePos;
				this.NoticeTime = Time.time;
				this.time_token = XSingleton<XTimerMgr>.singleton.SetTimer(this._notice_pertime, this._showSingleNoticeCb, num + 1);
				bool flag2 = num == this._notice_collection.Count - 1;
				if (flag2)
				{
					this._notice_collection.Clear();
				}
			}
		}

		// Token: 0x06010AAC RID: 68268 RVA: 0x00424DC8 File Offset: 0x00422FC8
		public void StopNotice()
		{
			bool flag = this.time_token > 0U;
			if (flag)
			{
				XSingleton<XTimerMgr>.singleton.KillTimer(this.time_token);
				this.time_token = 0U;
			}
			base.uiBehaviour.m_NoticeFrame.transform.localPosition = XGameUI.Far_Far_Away;
		}

		// Token: 0x06010AAD RID: 68269 RVA: 0x00424E18 File Offset: 0x00423018
		public void ShowSkillRemainingCD(string skillName, float time)
		{
			this.ShowBigNotice(XStringDefineProxy.GetString("SkillRemainingCD", new object[]
			{
				skillName,
				time.ToString()
			}), false);
		}

		// Token: 0x06010AAE RID: 68270 RVA: 0x00424E44 File Offset: 0x00423044
		public void ShowBigNotice(string text, bool bCmd)
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				XSingleton<XTimerMgr>.singleton.KillTimer(this._big_notice_timer_token);
				bool flag2 = this._big_notice == null;
				if (flag2)
				{
					this._big_notice = (XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab("UI/Common/TutorialButtomText", true, false) as GameObject);
					this._big_notice.transform.parent = base.uiBehaviour.transform;
					this._big_notice.transform.localPosition = Vector3.zero;
					this._big_notice.transform.localScale = Vector3.one;
				}
				IXUILabel ixuilabel = this._big_notice.transform.Find("TutorialText").GetComponent("XUILabel") as IXUILabel;
				ixuilabel.SetText(text);
				IXUITweenTool ixuitweenTool = this._big_notice.GetComponent("XUIPlayTween") as IXUITweenTool;
				ixuitweenTool.PlayTween(true, -1f);
				if (bCmd)
				{
					this._big_notice_timer_token = XSingleton<XTimerMgr>.singleton.SetTimer(5f, this._endBigNoticeCmdCb, null);
				}
				else
				{
					this._big_notice_timer_token = XSingleton<XTimerMgr>.singleton.SetTimer(3f, this._endBigNoticeCb, null);
				}
			}
		}

		// Token: 0x06010AAF RID: 68271 RVA: 0x00424F7C File Offset: 0x0042317C
		protected void EndBigNotice(object o)
		{
			bool flag = this._big_notice != null;
			if (flag)
			{
				XResourceLoaderMgr.SafeDestroy(ref this._big_notice, true);
			}
			this._big_notice_timer_token = 0U;
		}

		// Token: 0x06010AB0 RID: 68272 RVA: 0x00424FB0 File Offset: 0x004231B0
		protected void EndBigNoticeCmd(object o)
		{
			bool flag = this._big_notice != null;
			if (flag)
			{
				XResourceLoaderMgr.SafeDestroy(ref this._big_notice, true);
				XSingleton<XLevelScriptMgr>.singleton.ExecuteNextCmd();
			}
			this._big_notice_timer_token = 0U;
		}

		// Token: 0x06010AB1 RID: 68273 RVA: 0x00424FF0 File Offset: 0x004231F0
		protected void ClearBigNotice()
		{
			bool flag = this._big_notice != null;
			if (flag)
			{
				XResourceLoaderMgr.SafeDestroy(ref this._big_notice, true);
			}
			XSingleton<XTimerMgr>.singleton.KillTimer(this._big_notice_timer_token);
			this._big_notice_timer_token = 0U;
		}

		// Token: 0x06010AB2 RID: 68274 RVA: 0x00425038 File Offset: 0x00423238
		public void ShowAutoReviveFrame(int time, uint cost, uint costType)
		{
			bool flag = base.uiBehaviour.m_WorldBossHandler != null && base.uiBehaviour.m_WorldBossHandler.active;
			if (flag)
			{
				base.uiBehaviour.m_WorldBossHandler.SetAutoRevive(time, cost, costType);
			}
		}

		// Token: 0x06010AB3 RID: 68275 RVA: 0x00425080 File Offset: 0x00423280
		public void OnPlayerRevive()
		{
			bool flag = base.uiBehaviour.m_WorldBossHandler != null && base.uiBehaviour.m_WorldBossHandler.active;
			if (flag)
			{
				base.uiBehaviour.m_WorldBossHandler.HideAutoRevive();
			}
			base.uiBehaviour.m_LowHP.SetActive(false);
		}

		// Token: 0x06010AB4 RID: 68276 RVA: 0x004250D8 File Offset: 0x004232D8
		public float GetLeftTime()
		{
			return this.leftTimeCounter.GetFloatLeftTime();
		}

		// Token: 0x06010AB5 RID: 68277 RVA: 0x004250F8 File Offset: 0x004232F8
		public void HideLeftTime()
		{
			this.timeConnter.SetLeftTime(0f, -1);
			this.leftTimeCounter.SetLeftTime(0f, -1);
			base.uiBehaviour.m_LeftTime.SetVisible(false);
			base.uiBehaviour.m_WarTime.SetVisible(false);
		}

		// Token: 0x06010AB6 RID: 68278 RVA: 0x0042514E File Offset: 0x0042334E
		public void SetLeftTime(uint seconds, int noticeTime = -1)
		{
			base.uiBehaviour.m_LeftTime.SetVisible(true);
			this.leftTimeCounter.SetLeftTime(seconds, noticeTime);
			base.uiBehaviour.m_WarTime.SetVisible(false);
		}

		// Token: 0x06010AB7 RID: 68279 RVA: 0x00425188 File Offset: 0x00423388
		public void SetTimeRecord()
		{
			base.uiBehaviour.m_WarTime.SetVisible(true);
			this.timeConnter.SetForward(1);
			this.timeConnter.SetLeftTime(0.01f, -1);
			base.uiBehaviour.m_LeftTime.SetVisible(false);
		}

		// Token: 0x06010AB8 RID: 68280 RVA: 0x004251DC File Offset: 0x004233DC
		public void ResetLeftTime(int seconds)
		{
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag = sceneData.TimeCounter == null || sceneData.TimeCounter.Length < 1;
			if (flag)
			{
				this.timeConnter.SetLeftTime((float)seconds, -1);
			}
			else
			{
				bool flag2 = sceneData.TimeCounter[0] == 1;
				if (flag2)
				{
					this.leftTimeCounter.SetLeftTime((float)((int)sceneData.TimeCounter[1] - seconds), -1);
				}
			}
		}

		// Token: 0x06010AB9 RID: 68281 RVA: 0x00425258 File Offset: 0x00423458
		private void UpdateLeftTime()
		{
			bool sceneStarted = XSingleton<XScene>.singleton.SceneStarted;
			if (sceneStarted)
			{
				this.leftTimeCounter.Update();
			}
		}

		// Token: 0x06010ABA RID: 68282 RVA: 0x00425284 File Offset: 0x00423484
		private void UpdateTime()
		{
			bool sceneStarted = XSingleton<XScene>.singleton.SceneStarted;
			if (sceneStarted)
			{
				this.timeConnter.Update();
			}
		}

		// Token: 0x06010ABB RID: 68283 RVA: 0x003E6933 File Offset: 0x003E4B33
		public void OnSwitchToTeamChat(object obj)
		{
			DlgBase<XChatView, XChatBehaviour>.singleton.SelectChatTeam();
		}

		// Token: 0x06010ABC RID: 68284 RVA: 0x004252B0 File Offset: 0x004234B0
		public void OnVoiceButtonDrag(IXUIButton sp, Vector2 delta)
		{
			this.m_DragDistance += delta;
			bool flag = this.m_DragDistance.magnitude >= 100f;
			if (flag)
			{
				this.m_CancelRecord = true;
			}
			else
			{
				this.m_CancelRecord = false;
			}
		}

		// Token: 0x06010ABD RID: 68285 RVA: 0x004252FC File Offset: 0x004234FC
		public void OnVoiceButton(IXUIButton sp, bool state)
		{
			if (state)
			{
				XSingleton<XDebug>.singleton.AddLog("Press down", null, null, null, null, null, XDebugColor.XDebug_None);
				this.m_DragDistance = Vector2.zero;
				this.m_IsRecording = true;
				bool useApollo = XChatDocument.UseApollo;
				if (useApollo)
				{
					XSingleton<XChatApolloMgr>.singleton.StartRecord(VoiceUsage.CHAT, null);
				}
				else
				{
					XSingleton<XChatIFlyMgr>.singleton.StartRecord(VoiceUsage.CHAT, null);
				}
			}
			else
			{
				XSingleton<XDebug>.singleton.AddLog("Press up", null, null, null, null, null, XDebugColor.XDebug_None);
				this.m_IsRecording = false;
				DlgBase<XChatView, XChatBehaviour>.singleton.SetActiveChannel(ChatChannelType.Team);
				bool useApollo2 = XChatDocument.UseApollo;
				if (useApollo2)
				{
					XSingleton<XChatApolloMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
				else
				{
					XSingleton<XChatIFlyMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
			}
		}

		// Token: 0x06010ABE RID: 68286 RVA: 0x004253B8 File Offset: 0x004235B8
		public void OnStopVoiceRecord()
		{
			bool isRecording = this.m_IsRecording;
			if (isRecording)
			{
				DlgBase<XChatView, XChatBehaviour>.singleton.SetActiveChannel(ChatChannelType.Team);
				bool useApollo = XChatDocument.UseApollo;
				if (useApollo)
				{
					XSingleton<XChatApolloMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
				else
				{
					XSingleton<XChatIFlyMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
				this.m_IsRecording = false;
			}
		}

		// Token: 0x06010ABF RID: 68287 RVA: 0x00425414 File Offset: 0x00423614
		public bool OnCommandBtnClick(IXUIButton btn)
		{
			return true;
		}

		// Token: 0x06010AC0 RID: 68288 RVA: 0x00425428 File Offset: 0x00423628
		public bool OnAutoPlay(IXUIButton sp)
		{
			bool flag = !base.IsLoaded();
			return flag || this.SetAutoPlay(sp.ID == 1UL);
		}

		// Token: 0x06010AC1 RID: 68289 RVA: 0x0042545C File Offset: 0x0042365C
		private bool OnHorseRideClicked(IXUIButton btn)
		{
			bool flag = !base.IsLoaded();
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				XPetDocument specificDocument = XDocuments.GetSpecificDocument<XPetDocument>(XPetDocument.uuID);
				specificDocument.ReqRecentMount();
				result = true;
			}
			return result;
		}

		// Token: 0x06010AC2 RID: 68290 RVA: 0x00425494 File Offset: 0x00423694
		private bool SetAutoPlay(bool isAuto)
		{
			XPlayerAttributes xplayerAttributes = XSingleton<XEntityMgr>.singleton.Player.Attributes as XPlayerAttributes;
			xplayerAttributes.AutoPlayOn = isAuto;
			XAIComponent ai = XSingleton<XEntityMgr>.singleton.Player.AI;
			bool flag = ai != null && !XSingleton<XScene>.singleton.bSpectator;
			if (flag)
			{
				XAIEnableAI @event = XEventPool<XAIEnableAI>.GetEvent();
				@event.Firer = XSingleton<XEntityMgr>.singleton.Player;
				@event.Enable = isAuto;
				@event.Puppet = false;
				XSingleton<XEventMgr>.singleton.FireEvent(@event);
			}
			bool autoPlayOn = xplayerAttributes.AutoPlayOn;
			if (autoPlayOn)
			{
				base.uiBehaviour.m_AutoPlayBorad.SetVisible(false);
				base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(true);
				XSingleton<UiUtility>.singleton.ShowSystemNoticeTip(XStringDefineProxy.GetString("AutoPlayNotice"));
			}
			else
			{
				base.uiBehaviour.m_AutoPlayBorad.SetVisible(true);
				base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(false);
			}
			return true;
		}

		// Token: 0x06010AC3 RID: 68291 RVA: 0x00425590 File Offset: 0x00423790
		private void OnAutoPlayTip(IXUISprite go)
		{
			bool flag = !base.IsLoaded();
			if (!flag)
			{
				bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_ARENA;
				if (flag2)
				{
					XSingleton<UiUtility>.singleton.ShowSystemNoticeTip(XStringDefineProxy.GetString("ArenaAutoFight"));
				}
				else
				{
					XSingleton<UiUtility>.singleton.ShowSystemNoticeTip(string.Format(XStringDefineProxy.GetString("AutoFightOpenLevel"), XSingleton<XGlobalConfig>.singleton.GetValue("AutoPlayUnlockLevel")));
				}
			}
		}

		// Token: 0x06010AC4 RID: 68292 RVA: 0x00425600 File Offset: 0x00423800
		private bool OnBattleStatisticsClick(IXUIButton btn)
		{
			bool flag = base.uiBehaviour == null;
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				DlgHandlerBase.EnsureCreate<BattleStatisticsHandler>(ref this.m_BattleStatisticsHandler, base.uiBehaviour.m_canvas.transform, this.m_BattleStatisticsHandler == null || !this.m_BattleStatisticsHandler.IsVisible(), this);
				result = true;
			}
			return result;
		}

		// Token: 0x06010AC5 RID: 68293 RVA: 0x00425660 File Offset: 0x00423860
		public void ShowBattleVoice(ChatVoiceInfo info)
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				this.m_ChatLabelCd = XSingleton<XTimerMgr>.singleton.SetTimer((float)info.voiceTime + 2f, this._hideBattleChatUICb, info);
			}
		}

		// Token: 0x06010AC6 RID: 68294 RVA: 0x004256A1 File Offset: 0x004238A1
		public void HideBattleChatUI(object info)
		{
			this.m_ChatLabelCd = 0U;
		}

		// Token: 0x06010AC7 RID: 68295 RVA: 0x004256AC File Offset: 0x004238AC
		public void ShowCountDownFrame(bool status)
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				base.uiBehaviour.m_CountDownFrame.gameObject.SetActive(true);
				base.uiBehaviour.m_CountDownTimeFrame.gameObject.SetActive(status);
				base.uiBehaviour.m_CountDownBeginFrame.gameObject.SetActive(!status);
				(base.uiBehaviour.m_CountDownTimeFrame.gameObject.GetComponent("XUIPlayTween") as IXUITweenTool).PlayTween(status, -1f);
				(base.uiBehaviour.m_CountDownBeginFrame.gameObject.GetComponent("XUIPlayTween") as IXUITweenTool).PlayTween(!status, -1f);
			}
		}

		// Token: 0x06010AC8 RID: 68296 RVA: 0x00425770 File Offset: 0x00423970
		public void SetAutoPlayUI(bool isInAutoPlay)
		{
			bool flag = !this._can_auto_play;
			if (!flag)
			{
				this.SetAutoPlay(isInAutoPlay);
			}
		}

		// Token: 0x06010AC9 RID: 68297 RVA: 0x00425798 File Offset: 0x00423998
		public void OnPlaySuperarmorFx(XEntity enemy, bool bBroken)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy;
				if (flag)
				{
					this.EnemyInfoHandler.EnemyList[i].SetSuperArmorState(bBroken);
					break;
				}
			}
		}

		// Token: 0x06010ACA RID: 68298 RVA: 0x00425800 File Offset: 0x00423A00
		public void OnStopSuperarmorFx(XEntity enemy)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy;
				if (flag)
				{
					this.EnemyInfoHandler.EnemyList[i].StopSuperArmorFx();
					break;
				}
			}
		}

		// Token: 0x06010ACB RID: 68299 RVA: 0x00425868 File Offset: 0x00423A68
		public void OnProjectDamage(ProjectDamageResult damage, XEntity entity)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == entity;
				if (flag)
				{
					bool flag2 = damage.Caster == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID;
					if (flag2)
					{
						this.EnemyInfoHandler.EnemyList[i].OnBeHit(damage);
					}
					break;
				}
			}
		}

		// Token: 0x06010ACC RID: 68300 RVA: 0x004258EC File Offset: 0x00423AEC
		public void SetupSpeedFx(XEntity enemy, bool enable, Color c)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy;
				if (flag)
				{
					IXUISprite uiSuperArmorSpeedFx = this.EnemyInfoHandler.EnemyList[i].m_uiSuperArmorSpeedFx;
					uiSuperArmorSpeedFx.gameObject.SetActive(enable);
					uiSuperArmorSpeedFx.SetColor(c);
					break;
				}
			}
		}

		// Token: 0x06010ACD RID: 68301 RVA: 0x00425968 File Offset: 0x00423B68
		public void ShowStrengthPresevedBar(XEntity entity)
		{
			base.uiBehaviour.m_StrengthPresevedBar.SetVisible(true);
			this._strength_preseved_entity = entity;
			this._total_strength_preseved = (float)this._strength_preseved_entity.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentXULI_Basic);
			this._current_strength_preseved = this._total_strength_preseved;
			this.RefreshStrengthPresevedBar();
		}

		// Token: 0x06010ACE RID: 68302 RVA: 0x004259BB File Offset: 0x00423BBB
		public void HideStrengthPresevedBar()
		{
			base.uiBehaviour.m_StrengthPresevedBar.SetVisible(false);
			this._strength_preseved_entity = null;
			this._total_strength_preseved = 1f;
			this._current_strength_preseved = 0f;
		}

		// Token: 0x06010ACF RID: 68303 RVA: 0x004259F0 File Offset: 0x00423BF0
		public void RefreshStrengthPresevedBar()
		{
			bool flag = this._strength_preseved_entity != null && this._strength_preseved_entity.Attributes != null;
			if (flag)
			{
				this._current_strength_preseved = (float)this._strength_preseved_entity.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentXULI_Basic);
			}
			bool flag2 = base.uiBehaviour != null && base.uiBehaviour.m_StrengthPresevedBar != null;
			if (flag2)
			{
				base.uiBehaviour.m_StrengthPresevedBar.value = this._strength_preseved_precent;
			}
		}

		// Token: 0x06010AD0 RID: 68304 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		public void SetTargetTabVisable(bool status)
		{
		}

		// Token: 0x06010AD1 RID: 68305 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		public void OnTargetTabClick(IXUISprite sp)
		{
		}

		// Token: 0x06010AD2 RID: 68306 RVA: 0x00425A74 File Offset: 0x00423C74
		public bool OnSightSelectClick(IXUIButton sp)
		{
			bool flag = !base.IsLoaded();
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				this.SetView((XOperationMode)sp.ID);
				result = true;
			}
			return result;
		}

		// Token: 0x06010AD3 RID: 68307 RVA: 0x00425AA8 File Offset: 0x00423CA8
		public bool OnSightClick(IXUIButton sp)
		{
			bool flag = !base.IsLoaded();
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				bool flag2 = base.uiBehaviour == null || base.uiBehaviour.m_SightSelect == null;
				if (flag2)
				{
					result = false;
				}
				else
				{
					bool activeSelf = base.uiBehaviour.m_SightSelect.gameObject.activeSelf;
					if (activeSelf)
					{
						base.uiBehaviour.m_SightSelect.gameObject.SetActive(false);
					}
					else
					{
						base.uiBehaviour.m_SightSelect.gameObject.SetActive(true);
					}
					result = true;
				}
			}
			return result;
		}

		// Token: 0x06010AD4 RID: 68308 RVA: 0x00425B44 File Offset: 0x00423D44
		public void OnSpectateMessageChange(int watchNum, int commendNum)
		{
			XSpectateSceneDocument specificDocument = XDocuments.GetSpecificDocument<XSpectateSceneDocument>(XSpectateSceneDocument.uuID);
			bool spectateInfoIsShow = this.SpectateInfoIsShow;
			if (spectateInfoIsShow)
			{
				base.uiBehaviour.m_WatchNum.SetText(watchNum.ToString());
				base.uiBehaviour.m_CommendNum.SetText(commendNum.ToString());
			}
			else
			{
				bool flag = watchNum >= specificDocument.WatchTarget || commendNum >= specificDocument.CommendTarget;
				if (flag)
				{
					XSingleton<XDebug>.singleton.AddLog("watchNum and commendNum are enough now.", null, null, null, null, null, XDebugColor.XDebug_None);
					this.SpectateInfoIsShow = true;
					base.uiBehaviour.m_SpectateInfo.transform.localPosition = Vector3.zero;
					base.uiBehaviour.m_WatchNum.SetText(watchNum.ToString());
					base.uiBehaviour.m_CommendNum.SetText(commendNum.ToString());
				}
			}
		}

		// Token: 0x06010AD5 RID: 68309 RVA: 0x00425C28 File Offset: 0x00423E28
		public void ShowGuildMineBuff(ResWarBuffRes data)
		{
			bool flag = data == null || !base.IsLoaded();
			if (!flag)
			{
				bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_RESWAR_PVE;
				if (flag2)
				{
					GuildMineralBufflist.RowData mineBuffData = XGuildMineMainDocument.GetMineBuffData(data.buffid);
					bool flag3 = mineBuffData == null;
					if (flag3)
					{
						XSingleton<XDebug>.singleton.AddErrorLog("buffid:" + data.buffid, null, null, null, null, null);
					}
					else
					{
						uint num = mineBuffData.Quality - 1U;
						base.uiBehaviour.m_GuildMineBuff.gameObject.SetActive(true);
						base.uiBehaviour.m_GuildMineBuff.SetSprite(mineBuffData.icon);
						base.uiBehaviour.m_GuildMineBuffText.SetText(mineBuffData.ratestring);
						bool flag4 = (ulong)num >= (ulong)((long)DlgBase<GuildMineMainView, GuildMineMainBehaviour>.singleton.BossColor.Length);
						if (flag4)
						{
							XSingleton<XDebug>.singleton.AddErrorLog(string.Concat(new object[]
							{
								"bossMineBuffIndex:",
								num,
								"\nBossColor:",
								DlgBase<GuildMineMainView, GuildMineMainBehaviour>.singleton.BossColor.Length
							}), null, null, null, null, null);
							num = 0U;
						}
						bool flag5 = (ulong)num < (ulong)((long)DlgBase<GuildMineMainView, GuildMineMainBehaviour>.singleton.BossColor.Length);
						if (flag5)
						{
							base.uiBehaviour.m_GuildMineBuff.SetColor(XSingleton<UiUtility>.singleton.ParseColor(DlgBase<GuildMineMainView, GuildMineMainBehaviour>.singleton.BossColor[(int)num], 0));
							base.uiBehaviour.m_GuildMineBuffText.SetColor(XSingleton<UiUtility>.singleton.ParseColor(DlgBase<GuildMineMainView, GuildMineMainBehaviour>.singleton.BossColor[(int)num], 0));
						}
					}
				}
			}
		}

		// Token: 0x06010AD6 RID: 68310 RVA: 0x00425DC4 File Offset: 0x00423FC4
		public void SetLoadingPrompt(List<string> otherPalyerName, bool canAutoClose = false)
		{
			bool flag = !base.IsLoaded() || XSingleton<XGame>.singleton.CurrentStage.Stage != EXStage.World || !XSingleton<XGame>.singleton.SyncMode;
			if (!flag)
			{
				bool flag2 = otherPalyerName == null || otherPalyerName.Count == 0;
				if (flag2)
				{
					this.m_uiBehaviour.m_PromptLabel.SetText(XStringDefineProxy.GetString("WAIT_FOR_OTHERS"));
					bool flag3 = canAutoClose && this.m_uiBehaviour.m_PromptFrame.gameObject.activeSelf;
					if (flag3)
					{
						this.m_uiBehaviour.m_PromptFrame.gameObject.SetActive(false);
					}
				}
				else
				{
					string text = string.Format(XSingleton<UiUtility>.singleton.ReplaceReturn(XSingleton<XStringTable>.singleton.GetString("WAIT_OTHER_PLAYER_PVP")), otherPalyerName.Count, otherPalyerName[0]);
					this.m_uiBehaviour.m_PromptLabel.SetText(text);
				}
			}
		}

		// Token: 0x04007942 RID: 31042
		public static uint _pool_size = 5U;

		// Token: 0x04007943 RID: 31043
		private float NoticeTime = 0f;

		// Token: 0x04007944 RID: 31044
		private static Color32 _hp_green = new Color32(110, 174, 0, byte.MaxValue);

		// Token: 0x04007945 RID: 31045
		private static Color32 _hp_yellow = new Color32(196, 180, 32, byte.MaxValue);

		// Token: 0x04007946 RID: 31046
		private static Color32 _hp_red = new Color32(196, 57, 18, byte.MaxValue);

		// Token: 0x04007947 RID: 31047
		private static float _fYellow = 0f;

		// Token: 0x04007948 RID: 31048
		private static float _fRed = 0f;

		// Token: 0x04007949 RID: 31049
		private bool _can_auto_play = false;

		// Token: 0x0400794A RID: 31050
		private Vector2 m_DragDistance = Vector2.zero;

		// Token: 0x0400794B RID: 31051
		private bool m_CancelRecord = false;

		// Token: 0x0400794C RID: 31052
		private bool m_IsRecording = false;

		// Token: 0x0400794D RID: 31053
		private uint m_ChatLabelCd = 0U;

		// Token: 0x0400794E RID: 31054
		public ProfressionTrialsHandler ProfTrialsHandler;

		// Token: 0x0400794F RID: 31055
		public BattleShowInfoHandler m_BattleShowInfoHandler = null;

		// Token: 0x04007950 RID: 31056
		private BattleCaptainPVPHandler m_BattleCaptainPVPHandler = null;

		// Token: 0x04007951 RID: 31057
		private GuildMinePVPBattleHandler m_GuildMinePVPBattleHandler = null;

		// Token: 0x04007952 RID: 31058
		private GuildMinePVPInfoHandler m_GuildMinePVPInfoHandler = null;

		// Token: 0x04007953 RID: 31059
		private SkyArenaBattleHandler m_SkyArenaBattleHandler = null;

		// Token: 0x04007954 RID: 31060
		private SkyArenaInfoHandler m_SkyArenaInfoHandler = null;

		// Token: 0x04007955 RID: 31061
		private AbyssPartyBattleHandler m_AbyssPartyBattleHandler = null;

		// Token: 0x04007956 RID: 31062
		public BigMeleeBattleHandler m_BigMeleeBattleHandler = null;

		// Token: 0x04007957 RID: 31063
		public BattleFieldBattleHandler m_BattleFieldBattleHandler = null;

		// Token: 0x04007958 RID: 31064
		private XOptionsBattleHandler m_XOptionBattleHandler = null;

		// Token: 0x04007959 RID: 31065
		private RaceBattleHandler m_RaceBattleHandler = null;

		// Token: 0x0400795A RID: 31066
		public GuildMiniReportHandler m_miniReportHandler = null;

		// Token: 0x0400795B RID: 31067
		public BattleRiftHandler m_riftHandler = null;

		// Token: 0x0400795C RID: 31068
		public GuildBattleMiniRankHandler m_miniRankHandler = null;

		// Token: 0x0400795D RID: 31069
		public HeroBattleSkillHandler m_HeroBattleSkillHandler = null;

		// Token: 0x0400795E RID: 31070
		public HeroBattleHandler m_HeroBattleHandler = null;

		// Token: 0x0400795F RID: 31071
		public MobaBattleHandler m_MobaBattleHandler = null;

		// Token: 0x04007960 RID: 31072
		public WeekendPartyHandler m_WeekendPartyHandler = null;

		// Token: 0x04007961 RID: 31073
		public BattleStatisticsHandler m_BattleStatisticsHandler = null;

		// Token: 0x04007962 RID: 31074
		private BattleDpsHandler m_DpsHandler = null;

		// Token: 0x04007963 RID: 31075
		private SceneType sceneType;

		// Token: 0x04007964 RID: 31076
		private XLeftTimeCounter leftTimeCounter;

		// Token: 0x04007965 RID: 31077
		public XLeftTimeCounter timeConnter;

		// Token: 0x04007966 RID: 31078
		private List<string> _notice_collection = new List<string>();

		// Token: 0x04007967 RID: 31079
		private float _notice_duration = 0f;

		// Token: 0x04007968 RID: 31080
		private float _notice_pertime = 1f;

		// Token: 0x04007969 RID: 31081
		private List<ComboBuff> _combo_buff_list = new List<ComboBuff>();

		// Token: 0x0400796A RID: 31082
		private int _combo_buff_to_add = -1;

		// Token: 0x0400796B RID: 31083
		private int _combo_buff_added = -1;

		// Token: 0x0400796C RID: 31084
		private XBattleDocument _doc;

		// Token: 0x0400796D RID: 31085
		private XApolloDocument apolloDoc;

		// Token: 0x0400796E RID: 31086
		private uint time_token = 0U;

		// Token: 0x0400796F RID: 31087
		public bool SpectateInfoIsShow;

		// Token: 0x04007970 RID: 31088
		private XEntity _strength_preseved_entity = null;

		// Token: 0x04007971 RID: 31089
		private float _total_strength_preseved = 1f;

		// Token: 0x04007972 RID: 31090
		private float _current_strength_preseved = 0f;

		// Token: 0x04007973 RID: 31091
		private float _last_check_time = 0f;

		// Token: 0x04007974 RID: 31092
		private XTimerMgr.ElapsedEventHandler _showSingleNoticeCb = null;

		// Token: 0x04007975 RID: 31093
		private XTimerMgr.ElapsedEventHandler _endBigNoticeCb = null;

		// Token: 0x04007976 RID: 31094
		private XTimerMgr.ElapsedEventHandler _endBigNoticeCmdCb = null;

		// Token: 0x04007977 RID: 31095
		private XTimerMgr.ElapsedEventHandler _onSwitchToTeamChatCb = null;

		// Token: 0x04007978 RID: 31096
		private XTimerMgr.ElapsedEventHandler _hideBattleChatUICb = null;

		// Token: 0x04007979 RID: 31097
		private XSwitchSight m_SwitchSight;

		// Token: 0x0400797A RID: 31098
		private int _maxHP = 0;

		// Token: 0x0400797B RID: 31099
		private int _currentHP = 0;

		// Token: 0x0400797C RID: 31100
		private int _maxMP = 0;

		// Token: 0x0400797D RID: 31101
		private int _currentMP = 0;

		// Token: 0x0400797E RID: 31102
		public XYuyinView _yuyinHandler;

		// Token: 0x0400797F RID: 31103
		private int type;

		// Token: 0x04007980 RID: 31104
		private float lastPingTime = -60f;

		// Token: 0x04007981 RID: 31105
		private float lastDebugUITrigger = -1f;

		// Token: 0x04007982 RID: 31106
		private GameObject _big_notice = null;

		// Token: 0x04007983 RID: 31107
		private uint _big_notice_timer_token = 0U;
	}
}
